import { Component, OnInit } from '@angular/core';
import { NzMessageService, NzModalRef } from 'ng-zorro-antd';
import { SFSchema } from '@delon/form';
@Component({
  selector: 'app-notice-edit',
  templateUrl: './edit.component.html',
})
export class BusinessNoticeEditComponent implements OnInit {
  i: any = {};
  accountInfo: string = '新增公告';
  schema: SFSchema = {
    properties: {
      title: {
        type: 'string',
        title: '标题'
      },
      describe: {
        type: 'string',
        title: '内容',
        ui: {
          widget: 'textarea',
          autosize: { minRows: 2, maxRows: 6 },
        },
      },
    },
    required: ['title', 'describe'],
    ui: {
      spanLabelFixed: 80,
      grid: { span: 24 },
    },
  };
  constructor(private modal: NzModalRef, private msgSrv: NzMessageService) {}
  ngOnInit() {
    if(this.i._id) {
      this.accountInfo = '修改公告'
    }
  }
  save(value: any) {
    // this.msgSrv.success('保存成功');
    value.initiator = '袁巧';
    this.modal.close(value);
  }
  close() {
    this.modal.destroy();
  }
}
